package com.springboot.service.admin.adminInfo.impl;

import com.springboot.dao.AdminInfoDao;
import com.springboot.entity.AdminInfo;
import com.springboot.service.admin.adminInfo.AdminLoginAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author : sugar without coffee
 * @version 1.0.0
 */
@Service
public class AdminLoginAuthServiceImpl implements AdminLoginAuthService {

    @Autowired
    AdminInfoDao adminInfoDaoImpl;

    @Override
    public boolean adminLoginAuth(AdminInfo adminInfo) {
        try{
            if(adminInfo.getAdminPassword().equals(adminInfoDaoImpl.selectAdminInfoByAdminId(adminInfo.getAdminId()).get("adminPassword"))){
                return true;
            }else{
                return false;
            }
        }catch (NullPointerException ex){
            return false;
        }
    }

}
